home *** CD-ROM | disk | FTP | other *** search
- Subject: dev mtime, filesys.h, virtual console patch
- Date: Sat, 19 Feb 94 2:22:44 CET
- From: Juergen Lock <nox@jelal.north.de>
- In-Reply-To: <199402171855.AA05725@techfac.TechFak.Uni-Bielefeld.DE>; from "Torsten Scherer" at Feb 17, 94 5:17 pm
- Message-Id: <9402190122.AA00202@jelal.north.de>
-
- Torsten Scherer writes:
-
- > diff -u4 orig/dos.c ./dos.c
- >...
- > --- cut cut cut ---
- >
- > Otherwise most of the /dev entires look a bit stupid, with 1980 as the year
- > of their creation and use and so...
-
- btw to support the date stuff in device drivers some updated version of
- filesys.h would be useful... (or should i hack a perlscript to make one
- from file.h? :)
-
- anyway, link 1.10 file.h to filesys.h for now. the first patch is a hack
- for the gemini TIOCGWINSZ problem (sigh why don't people use ptys...) and
- the rest is for the atime/mtimes.
-
- Index: vtdev.c
- @@ -1138,6 +1138,10 @@
- screen_datime, screen_close, screen_select, screen_unselect
- };
-
- +#ifdef VT00XCON
- +static long xconout_start;
- +#endif
- +
- static long ARGS_ON_STACK
- screen_open(f)
- FILEPTR *f;
- @@ -1148,7 +1152,7 @@
- if (!rowoff) {
- #ifdef VT00XCON
- /* if vt00 should write thru xconout be sure its there :) */
- - if (!xconout[CONDEV])
- + if (!(xconout_start = xconout[CONDEV]))
- return -EINTERNAL;
- #endif
- if ((fd = init()))
- @@ -1350,6 +1373,14 @@
- w = (struct winsize *)buf;
- w->ws_row = v->maxy+1;
- w->ws_col = v->maxx+1;
- +#ifdef VT00XCON
- + /* another compatibility hack for those `never heared of ptys'
- + GEM programs: if the vector changed since we started the
- + console size is `unknown'...
- + */
- + if (!vt && xconout[CONDEV] != xconout_start)
- + w->ws_row = w->ws_col = 0;
- +#endif
- }
- #ifdef VT00XCON
- else if (vt && mode >= TCURSOFF && mode <= TCURSGRATE)
-
- Index: vcon.h
- @@ -1,5 +1,3 @@
- -#include "filesys.h"
- -
- #ifdef __GNUC__
- #define EXITING volatile /* function never returns */
- #else
- @@ -10,8 +8,12 @@
- #ifdef __TURBOC__
- #define ARGS_ON_STACK cdecl
- #else
- +#ifdef __CDECL
- +#define ARGS_ON_STACK __CDECL
- +#else
- #define ARGS_ON_STACK
- #endif
- +#endif
-
- /* define to indicate unused variables */
- #ifdef __TURBOC__
- @@ -20,6 +22,19 @@
- #define UNUSED(x)
- #endif
-
- +#ifndef P_
- +# ifdef __STDC__
- +# define P_(x) x
- +# else
- +# define P_(x) ()
- +# endif
- +#endif
- +
- +#define ushort unsigned short
- +typedef long (*Func)();
- +
- +#include "filesys.h"
- +
- #define CTRL(x) ((x) & 0x1f)
- #ifndef T_NOFLSH
- #define T_NOFLSH 0x0040 /* don't flush buffer when signals
- Index: vtdev.c
- @@ -1214,7 +1218,7 @@
- return 0;
- }
-
- -#define _hz_200 (*((long *)0x4baL))
- +#define _hz_200 (*((unsigned long *)0x4baL))
-
- static long ARGS_ON_STACK
- screen_write(f, buf, bytes)
- @@ -1225,7 +1229,10 @@
- long *r;
- long ret = 0;
- int c;
- - long tick;
- + unsigned long tick;
- + static unsigned long lastw;
- + static int lastv;
- + extern int __mint;
-
- /* tty_write is calling us with no more than one line or 128
- chars at a time but still never(?) allows task-switches
- @@ -1298,6 +1305,14 @@
- if (tick != _hz_200 && !(tick & 3))
- yield();
- #endif
- + if (ret > 0 && (vt != lastv || (_hz_200 - lastw) >= 100) &&
- + __mint > 0x109) {
- + struct bios_file *b = (struct bios_file *)f->fc.index;
- + lastw = _hz_200;
- + lastv = vt;
- + b->xattr.atime = b->xattr.mtime = TGETTIME();
- + b->xattr.adate = b->xattr.mdate = TGETDATE();
- + }
- return ret;
- }
-
- @@ -1306,10 +1321,18 @@
- FILEPTR *f; char *buf; long bytes;
- {
- int vt = f->fc.aux;
- + long ret;
- + extern int __mint;
-
- if ((f->flags & O_NDELAY) != q_fl[vt])
- FCNTL (qfd[vt], (long)(q_fl[vt] = f->flags&O_NDELAY), F_SETFL);
- - return FREAD (qfd[vt], bytes, buf);
- + ret = FREAD (qfd[vt], bytes, buf);
- + if (ret > 0 && __mint > 0x109) {
- + struct bios_file *b = (struct bios_file *)f->fc.index;
- + b->xattr.atime = TGETTIME();
- + b->xattr.adate = TGETDATE();
- + }
- + return ret;
- }
-
- static long ARGS_ON_STACK
- Index: vtdev.h
- @@ -1,4 +1,6 @@
- /* kernel calls... */
- +#define TGETDATE (*kernel->dos_tab[0x2a])
- +#define TGETTIME (*kernel->dos_tab[0x2c])
- #define FOPEN (*kernel->dos_tab[0x3d])
- #define FCLOSE (*kernel->dos_tab[0x3e])
- #define FREAD (*kernel->dos_tab[0x3f])
- --
- J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
- ...ohne Gewehr
- PGP public key fingerprint = 8A 18 58 54 03 7B FC 12 1F 8B 63 C7 19 27 CF DA
-